Skip to content

Conversation

@Savid
Copy link
Contributor

@Savid Savid commented Mar 29, 2025

  • [ui] add macros section to settings to create/edit/delete macros
  • [ui] add macro bar under the actionbar to execute macros
  • [server] add json rpc to get/set the macros
  • [server] save macros to config

Macro bar

image

Settings

image
image
image

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2025

CLA assistant check
All committers have signed the CLA.

@Nevexo
Copy link
Contributor

Nevexo commented Mar 29, 2025

This looks amazing! Thanks for working on it.

@adamshiervani adamshiervani requested a review from Copilot April 1, 2025 22:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements support for keyboard macros by adding a macros section in both the settings UI and action bar, as well as introducing JSON RPC endpoints on the server to get and set macros.

  • Adds new UI components and routing for managing keyboard macros
  • Enhances client-side hooks and state management to support macro execution
  • Implements server-side API endpoints and configuration updates to persist macros

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/routes/devices.$id.settings.tsx Added a new navigation link for keyboard macros in settings
ui/src/main.tsx Registered new routes for macros in the app routing configuration
ui/src/hooks/useKeyboard.ts Added an executeMacro function to process macro steps
ui/src/hooks/stores.ts Introduced macros state and functions to load and save keyboard macros
ui/src/components/WebRTCVideo.tsx Integrated MacroBar component into the video layout
ui/src/components/MacroBar.tsx New component rendering a macro bar with buttons for each macro
jsonrpc.go Added JSON RPC handlers for getting and setting keyboard macros
config.go Added configuration types and validation for keyboard macros
Files not reviewed (1)
  • ui/src/index.css: Language not supported

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@adamshiervani adamshiervani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work — thanks for taking the time to put this together. It’s a superb implementation, and the attention to detail really shows. Much appreciated.

Most of the comments are around UI consistency and readability: use existing components where possible, and split the macro settings file into multiple routes to keep things clear.

Copy link
Contributor

@adamshiervani adamshiervani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Even better second iteration
  • Arrows feel much better than DnD

@Savid Savid requested a review from adamshiervani April 5, 2025 14:06
Copy link
Contributor

@adamshiervani adamshiervani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have too much left to say. You've done a wonderful job. Fix the remaining things from the last review, and these tiny change requests and then we should be able to merge

@Savid Savid requested a review from adamshiervani April 9, 2025 13:45
@Savid
Copy link
Contributor Author

Savid commented Apr 9, 2025

i'm getting some local dev issues from this commit #336 when running ui from https://github.com/jetkvm/kvm/blob/dev/ui/dev_device.sh

@adamshiervani
Copy link
Contributor

Fixed and merged in: #342

@adamshiervani adamshiervani merged commit af0f452 into jetkvm:dev Apr 10, 2025
8 checks passed
@adamshiervani
Copy link
Contributor

Great work, @Savid! Will be included in the next version 0.4.0.

ym pushed a commit that referenced this pull request Apr 10, 2025
* add jsonrpc keyboard macro get/set

* add ui keyboard macros settings and macro bar

* use notifications component and handle jsonrpc errors

* cleanup settings menu

* return error rather than truncate steps in validation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(ui): add className prop to Checkbox component to allow custom styling

* use existing components and CTA

* extract display key mappings

* create generic combobox component

* remove macro description

* cleanup styles and macro list

* create sortable list component

* split up macro routes

* remove sortable list and simplify

* cleanup macrobar

* use and add info to fieldlabel

* add useCallback optimizations

* add confirm dialog component

* cleanup delete buttons

* revert info on field label

* cleanup combobox focus

* cleanup icons

* set default label for delay

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ReanimationXP
Copy link

ReanimationXP commented Apr 12, 2025

This is really awesome - I'm not sure what exactly the edit buttons do when viewing the macros steps, so maybe you already have this, but it would be cool to expand this for easy use with really long strings (one-liners, long passwords, password prefixes, api keys, etc). Could this be improved to support those use cases as well? It'd be nice to have like a text area for something like duckyscript rather than having to enter each character in one at a time via a GUI, so I could put common one-liners like "apt-get update; apt-get upgrade;ENTER" on a button without it being 5 pages long and taking half an hour to enter in :) (actual duckyscript would be slightly different but you get the idea. it supports specifying the delay and strings and other things too.)

Quick Intro: https://github.com/dekuNukem/duckyPad/blob/master/duckyscript_info.md
Full Reference: https://docs.hak5.org/hak5-usb-rubber-ducky/duckyscript-tm-quick-reference

I don't know that supporting the full spec would be necessary because DuckyScript 3 gets into if statements and so forth, but support for the basics like strings, special characters and escaping presumably, and special keys would be really really awesome. I can't purchase a unit right now due to US orders being shut down over tariffs, but I applied for a PoE beta unit, and if I were sent one I would happily look into making this a reality, and I'd love to have OP's help if they don't want to do it themselves :)

ym pushed a commit to ym/jetkvm-kvm that referenced this pull request Jun 13, 2025
* add jsonrpc keyboard macro get/set

* add ui keyboard macros settings and macro bar

* use notifications component and handle jsonrpc errors

* cleanup settings menu

* return error rather than truncate steps in validation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(ui): add className prop to Checkbox component to allow custom styling

* use existing components and CTA

* extract display key mappings

* create generic combobox component

* remove macro description

* cleanup styles and macro list

* create sortable list component

* split up macro routes

* remove sortable list and simplify

* cleanup macrobar

* use and add info to fieldlabel

* add useCallback optimizations

* add confirm dialog component

* cleanup delete buttons

* revert info on field label

* cleanup combobox focus

* cleanup icons

* set default label for delay

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ym pushed a commit to ym/jetkvm-kvm that referenced this pull request Sep 26, 2025
* add jsonrpc keyboard macro get/set

* add ui keyboard macros settings and macro bar

* use notifications component and handle jsonrpc errors

* cleanup settings menu

* return error rather than truncate steps in validation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(ui): add className prop to Checkbox component to allow custom styling

* use existing components and CTA

* extract display key mappings

* create generic combobox component

* remove macro description

* cleanup styles and macro list

* create sortable list component

* split up macro routes

* remove sortable list and simplify

* cleanup macrobar

* use and add info to fieldlabel

* add useCallback optimizations

* add confirm dialog component

* cleanup delete buttons

* revert info on field label

* cleanup combobox focus

* cleanup icons

* set default label for delay

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants